package com.example.hello;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class HelloCustomer {
    @RabbitListener(queuesToDeclare = @Queue("work"))
    public void wp(){
        for(int i =0;i<10;i++){
            System.out.println("HelloCustomer.wp:"+i);
        }
        System.out.println("work得到消息:");
    }
//    @RabbitListener(queuesToDeclare = @Queue("work"))
//    public void wp1(String message){
//        System.out.println("work1得到消息:"+message);
//    }
}
